﻿@model MemberPoint.Entity.ViewModels.LoginViewModel.LoginViewModel

@{
    Layout = null;
}

<!DOCTYPE html>

<html>
<head>
    <meta name="viewport" content="width=device-width" />
    <title>Login</title>
    <link href="~/Content/easy-ui/icon.css" rel="stylesheet" />
    <link href="~/Content/easy-ui/default/easyui.css" rel="stylesheet" />
    <script src="~/scripts/easy-ui/jquery-1.11.1.js"></script>
    <script src="~/scripts/easy-ui/jquery.min.js"></script>
    <script src="~/scripts/easy-ui/jquery.easyui.min.js"></script>
    <style type="text/css">
        #big{ background-image:url(~/Content/images/cloud.jpg);}
    </style>
</head>
<body>
    @using (Html.BeginForm("Index", "Login", FormMethod.Post, new { id = "form_Login" }))
    {
        <div id="big" style="width:600px; height:360px; margin:auto; float:left">
            <div style="width:300px; height:310px; margin:auto; border:0px solid; margin-top:40px;">
                <div style="width:300px; height:25px; background-color:(25,180,234); font-size:20px;">
                    用户登录
                </div>
                <div style="width:300px; height:275px; background-color:aliceblue; float:left">
                    <div style="width:120px; height:120px; margin-left:90px; margin-top:20px; background:url(~/Content/images/people.png)">

                    </div>
                    <div style="width:240px; height:28px; float:left; margin-left:50px">
                        <img src="~/Content/images/i1.png" />
                        @Html.EditorFor(model => model.U_LoginName, new { htmlAttributes = new { @id = "txtshopname" } })
                        @Html.ValidationMessageFor(model => model.U_LoginName, "", new { @class = "text-danger" })
                    </div>
                    <div style="width:240px; height:28px; float:left; margin-left:50px">
                        <img src="~/Content/images/i2.png" />
                        @Html.EditorFor(model => model.U_Password, new { htmlAttributes = new { @id = "txtshoppwd" } })
                        @Html.ValidationMessageFor(model => model.U_Password, "", new { @class = "text-danger" })
                    </div>
                    <div style="width:157px; height:40px; margin-left:130px; float:left">
                        <a id="loginbtn" href="javascript:" @*style="background:url(images/login_btn.png); width:157px; height:40px"*@ name="btnlogin">登录</a>
                    </div>
                </div>
            </div>
        </div>
    }
</body>
</html>
<script>
    $(function () {
        $("#loginbtn").click(function () {
            $("#form_Login").form("submit", {
                url: "/Login/IsLogin",
                onSubmit: function () {
                    var isValid = $(this).form("validate");
                    return isValid;
                },
                success: function (data) {
                    var json = JSON.parse(data);
                    if (json.ResultStatus == 1) {
                        //提示消息
                        window.parent.$.messager.alert('温馨提示', json.Msg, 'info', function (r) {
                            location.href = "/Login/Home";
                        });
                    }
                    else {
                        $.messager.alert("温馨提示", json.Msg, "error");
                    }
                }
            })
        })
    })
</script>
